package com.blueberry.quiz_master.quiz.controller;

import com.blueberry.quiz_master.quiz.app.QuestionApp;
import com.blueberry.quiz_master.quiz.model.QuestionDTO;
import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("question")
public class QuestionController {
    @Resource
    private ChatModel dashScopeChatModel;

    @Autowired
    private QuestionApp questionApp;

    @GetMapping("create")
    public QuestionDTO createQuestion(@RequestParam String prompt) {
        return questionApp.createQuestion(prompt);
    }
}
